<ul class="pagination" ng-if="pagination && pagination.length > 1">
    <li ng-if="page != 1">
        <a ng-href="#{{base}}"><i class="fa fa-angle-double-left"></i></a>
    </li>
    <li ng-if="page != 1">
        <a ng-href="#{{base}}/page/{{page - 1}}" ng-if="p != 2">&lsaquo;</a>
        <a ng-href="#{{base}}" ng-if="p == 2">&laquo;</a>
    </li>
    <li ng-repeat="p in pagination" ng-class="{active: page == p}">
        <a ng-href="#{{base}}/page/{{p}}" ng-if="p != 1 && page != p">{{p}}</a>
        <a ng-href="#{{base}}" ng-if="p == 1 && page != p">{{p}}</a>
        <a ng-if="page == p">{{p}}</a>
    </li>
    <li ng-if="page < pagination.length">
        <a ng-href="#{{base}}/page/{{page + 1}}">&rsaquo;</a>
    </li>
    <li ng-if="page < pagination.length">
        <a ng-href="#{{base}}/page/{{pagination.length}}">&raquo;</a>
    </li>
</ul>